package com.xzp.ch06.anno;

import com.xzp.entity.Items;
import com.xzp.entity.OrderDetail;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderDetailAndItemsMapper{





    @Select("select * from orderdetail where ordersid=#{oid}")
    @Results(
            {
                    @Result(id=true,column="id",property="id"),
                    @Result(column="items_id",property="items",javaType = Items.class),
                    @Result(column="itemsid",property="items",
                            one=@One(select="com.xzp.ch06.anno.ItemsMapper.selectItemsById")
                    )
            }
    )
public List<OrderDetail> selectDetailAndItems(Integer oid);




}

